local Talents = require("engine.interface.ActorTalents")

newEntity{
	define_as = "BASE_NPC_ELEMENTAL",
	type = "elemental", subtype = "elemental",
	display = "E", color=colors.WHITE,
	desc = "ElEmEnTaLs", rank = 1,
	ai = "dumb_talented_simple", ai_state = { talent_in=3, },
	combat = { dam=2, atk=10, apr=2 },
	combat_armor = 0, combat_defense = 0
}

newEntity{ base = "BASE_NPC_ELEMENTAL",
	define_as = "EARTH_ELEMENTAL", subtype = "earth",
	name = "earth elemental", color=colors.UMBER,
	desc = "This brawny being, seemingly made of stone and earth and as tall as a mountain, lumbers toward you.",
	level_range = {1, 50}, exp_worth = 1,
	rarity = 1, life_rating = 15,
	max_life = resolvers.rngavg(12,15),
	stats = { str=11, dex=8, con=12 },
	combat = { damtype=DamageType.EARTH },
	resists = { [DamageType.EARTH] = 50, [DamageType.LIGHTNING] = -50, },
}

newEntity{ base = "BASE_NPC_ELEMENTAL",
	define_as = "FIRE_ELEMENTAL", subtype = "fire",
	name = "fire elemental", color=colors.RED,
	desc = "Flames flicker and dance around, is this a cozy campfire or a raging inferno?",
	level_range = {1, 50}, exp_worth = 1,
	rarity = 1,
	max_life = resolvers.rngavg(9,11),
	stats = { str=12, dex=11, con=9 },
	combat = { dam=3, damtype=DamageType.FIRE },
	resists = { [DamageType.FIRE] = 50, [DamageType.COLD] = -50, },
}

newEntity{ base = "BASE_NPC_ELEMENTAL",
	define_as = "AIR_ELEMENTAL", subtype = "air",
	name = "air elemental", color=colors.YELLOW,
	desc = "Nigh invisible, this elemental causes the air around it to charge up as it dashes toward you with speed and grace.",
	level_range = {1, 50}, exp_worth = 1,
	rarity = 1, life_rating = 9,
	max_life = resolvers.rngavg(7,9),
	stats = { str=9, dex=15, con=8 },
	combat = { damtype=DamageType.LIGHTNING },
	resists = { [DamageType.LIGHTNING] = 50, [DamageType.EARTH] = -50, },
}

newEntity{ base = "BASE_NPC_ELEMENTAL",
	define_as = "WATER_ELEMENTAL", subtype = "water",
	name = "water elemental", color=colors.BLUE,
	desc = "This elemental takes the form of a crushing wave that rises up and engulfs its surroundings.",
	level_range = {1, 50}, exp_worth = 1,
	rarity = 1,
	max_life = resolvers.rngavg(9,11),
	stats = { str=11, dex=10, con=11 },
	combat = { damtype=DamageType.COLD },
	resists = { [DamageType.COLD] = 50, [DamageType.FIRE] = -50, },
}

-- hidden types, only show up outside of the temples if the player can play them (or opens the temple up)
if profile.mod.allow_build.mana and "allow" then
	newEntity{ base = "BASE_NPC_ELEMENTAL",
		define_as = "MANA_ELEMENTAL", subtype = "mana",
		name = "mana elemental", color=colors.ORCHID,
		desc = "This strange scintillating elemental seems to blink in and out of reality",
		level_range = {1, 50}, exp_worth = 1,
		rarity = 1, life_rating = 12,
		max_life = resolvers.rngavg(15,20),
		stats = { str=15, dex=15, con=15 },
		ai = "dumb_talented_simple", ai_state = { talent_in=3, },
		combat = { damtype=DamageType.MANA },
		resists = { [DamageType.COLD] = 50, [DamageType.EARTH] = 50, [DamageType.FIRE] = 50, [DamageType.LIGHTNING] = 50, [DamageType.MANA] = 50, [DamageType.CHAOS] = -50, },
	}
end

if profile.mod.allow_build.chaos and "allow" then
	newEntity{ base = "BASE_NPC_ELEMENTAL",
		define_as = "CHAOS_ELEMENTAL", subtype = "chaos",
		name = "chaos elemental", color=colors.PURPLE,
		shader = "chaos_hue",
		desc = "Ever strange, ever shifting, this morphing elemental looks upon you with scorn and hate.",
		level_range = {1, 50}, exp_worth = 1,
		rarity = 1, life_rating = 11,
		max_life = resolvers.rngavg(9,11),
		stats = { str=17, dex=17, con=17 },
		combat = { damtype=DamageType.CHAOS },
		resists = { [DamageType.COLD] = -20, [DamageType.EARTH] = -20, [DamageType.FIRE] = -20, [DamageType.LIGHTNING] = -20, [DamageType.MANA] = -20, [DamageType.MANA] = -75, },
	}
end
